home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96a.txt / 000184_icon-group-sender _Wed Aug 14 10:26:46 1996.msg < prev    next >
Internet Message Format  |  1996-09-05  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Wed, 14 Aug 1996 13:12:03 MST
  2. Date: Wed, 14 Aug 1996 10:26:46 -0500
  3. Message-Id: <199608141526.KAA01341@ns1.computek.net>
  4. Mime-Version: 1.0
  5. Content-Type: text/plain
  6. Content-Transfer-Encoding: 7bit
  7. From: gep2@computek.net
  8. Subject: Problem with graphics
  9. To: rjhare@tattoo.ed.ac.uk, icon-group@cs.arizona.edu
  10. X-Mailer: SPRY Mail Version: 04.00.06.17
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: RO
  13.  
  14. >I wish to superimpose a dashed grid on my window to use as a guide for the
  15. positioning of objects (and some text) to be drawn in the window. When I
  16. save the window, I do not want the positioning grid to be part of the saved
  17. image. I cannot redraw the grid with "drawop=reverse" because that may well
  18. 'undraw' some components of the objects I have drawn. Any thoughts about how
  19. to do this please?
  20.  
  21. This is rather like the "sprites" question which comes up all the time in the 
  22. design and implementation of video games.
  23.  
  24. There are a whole variety of approaches that can be used, which fall into at 
  25. least three types of categories:
  26.  
  27. 1)  reconstruction... prior to saving, you reconstruct the image but without the 
  28. grid (this is the kind of thing that AutoCAD does).
  29.  
  30. 2)  masking... when you're drawing on the grid, you keep a separate mask which 
  31. records where the objects are that are drawn since the grid.  Before saving, you 
  32. then use the mask to clear (or merge from another image, perhaps) everything 
  33. drawn previously (i.e. all the background).
  34.  
  35. 3)  palette tricks... where you use a special color (or a small number of 
  36. special colors) in your grid and background and ensure that the same exact 
  37. colors are not duplicated in the objects drawn later.  Then before saving, you 
  38. either clear all pixels of the "special" colors, or else you reload the palette 
  39. so that pixels of the "special" colors are displayed in the same color as the 
  40. surrounding background.
  41.  
  42. In short, there is no one "right" solution to this issue... it all depends on a 
  43. whole variety of tradeoffs of speed, complexity, memory utilization, etc. etc.
  44.  
  45. Gordon Peterson
  46. http://www.computek.net/public/gep2/
  47.  
  48.